import * as React from "react"
import { ISku } from '../../types'
import style from "./style.module.css"
import { Link } from "react-router-dom"

interface Props {
  sku: ISku
}

function ProductItem(props: Props) {
  return (
    <Link to={"/detail/" + props.sku.id} className={style.ProductItem}>
      <img alt='' src={props.sku.cover} className={style.cover} />
      <div className={style.ProductItemBottom}>
        <div className={style.ProductItemTitle}>{props.sku.title}</div>
        <div className={style.ProductItemPrice}>￥{props.sku.price}</div>
      </div>
    </Link>
  )
}
export default ProductItem
